package com.bingxue.edu.management.shop.service;

import com.bingxue.edu.framework.mybatis.base.BaseService;
import com.bingxue.edu.management.shop.mapper.ActivityMapper;
import com.bingxue.edu.management.shop.model.entity.Activity;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import static com.bingxue.edu.management.shop.model.entity.table.ActivityTableDef.ACTIVITY;

/**
 * 活动
 * @author panbo
 * @since 2024/11/12
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class ActivityService extends BaseService<ActivityMapper, Activity> {

    public Activity getByCode(String ldxCode) {
        return this.queryChain().where(ACTIVITY.CODE.eq(ldxCode)).one();
    }
}
